//
//  AddBankCardModel.m
//  DaiShengInvest
//
//  Created by 张睿 on 2017/7/19.
//  Copyright © 2017年 davinci. All rights reserved.
//

#import "AddBankCardModel.h"

@implementation AddBankCardModel

+(instancetype)modelWithDictionary:(NSDictionary *)dic{
    
    AddBankCardModel *model =[[AddBankCardModel alloc] init];
    
    [model setValuesForKeysWithDictionary:dic];
    
    return model;
}


+(void)bankInfoStringWithSucess:(void (^)(NSArray<AddBankCardModel *> *))sucessBlock error:(void (^)())errorBlock{
    
    
    [[NetworkTool sharedTools] POST:@"user/bank-list" parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, NSDictionary *  _Nullable responseObject) {
        
        NSArray * paramArray = responseObject[@"param"];
        NSMutableArray *mArray = [NSMutableArray array];
        
        [paramArray enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            
            AddBankCardModel * model = [AddBankCardModel modelWithDictionary:obj];
            
            [mArray addObject:model];
            
        }];
        
        if(sucessBlock){
            sucessBlock(mArray.copy);
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    }];
    
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
}

@end
